home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / CoreFoundation / CFPreferences.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  3.9 KB  |  139 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        CFPreferences.h
  3.  
  4.      Contains:    CoreFoundation preferences
  5.  
  6.      Version:    Technology:    Mac OS X
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __COREFOUNDATION_CFPREFERENCES__
  18. #define __COREFOUNDATION_CFPREFERENCES__
  19.  
  20. #ifndef __COREFOUNDATION_CFBASE__
  21.     #include <CoreFoundation\CFBase.h>
  22. #endif
  23.  
  24. #ifndef __COREFOUNDATION_CFARRAY__
  25.     #include <CoreFoundation\CFArray.h>
  26. #endif
  27.  
  28. #ifndef __COREFOUNDATION_CFDICTIONARY__
  29.     #include <CoreFoundation\CFDictionary.h>
  30. #endif
  31.  
  32. #ifndef __COREFOUNDATION_CFSTRING__
  33.     #include <CoreFoundation\CFString.h>
  34. #endif
  35.  
  36.  
  37.  
  38.  
  39. #if PRAGMA_ONCE
  40. #pragma once
  41. #endif
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_IMPORT
  48. #pragma import on
  49. #endif
  50.  
  51. #if PRAGMA_STRUCT_ALIGN
  52.     #pragma options align=mac68k
  53. #elif PRAGMA_STRUCT_PACKPUSH
  54.     #pragma pack(push, 2)
  55. #elif PRAGMA_STRUCT_PACK
  56.     #pragma pack(2)
  57. #endif
  58.  
  59. extern const CFStringRef kCFPreferencesAnyApplication;
  60. extern const CFStringRef kCFPreferencesAnyHost;
  61. extern const CFStringRef kCFPreferencesCurrentHost;
  62. extern const CFStringRef kCFPreferencesAnyUser;
  63. extern const CFStringRef kCFPreferencesCurrentUser;
  64. /* Searches the various sources of application defaults to find the value for the given key.  
  65.    key must not be NULL.  If a value is found, it returns it; otherwise returns NULL.  Caller 
  66.    must release the returned value */
  67. EXTERN_API_C( CFTypeRef )
  68. CFPreferencesCopyAppValue        (CFStringRef             key,
  69.                                  CFStringRef             appName);
  70.  
  71. /* Sets the given value for the given key in the "normal" place for application preferences.  
  72.    key must not be NULL.  If value is NULL, key is removed instead. */
  73. EXTERN_API_C( void )
  74. CFPreferencesSetAppValue        (CFStringRef             key,
  75.                                  CFTypeRef                 value,
  76.                                  CFStringRef             appName);
  77.  
  78. /* Writes all changes in all sources of application defaults.  Returns success or failure. */
  79. EXTERN_API_C( Boolean )
  80. CFPreferencesAppSynchronize        (CFStringRef             appName);
  81.  
  82.  
  83. /* The primitive get mechanism; all arguments must be non-NULL (use the constants above for common values).  
  84.    Only the exact location specified by app-user-host is searched.  The returned CFType must be released by 
  85.    the caller when it is finished with it. */
  86. EXTERN_API_C( CFTypeRef )
  87. CFPreferencesCopyValue            (CFStringRef             key,
  88.                                  CFStringRef             appName,
  89.                                  CFStringRef             user,
  90.                                  CFStringRef             host);
  91.  
  92. /* The primitive set function; all arguments except value must be non-NULL.  If value is NULL, the given key is removed */
  93. EXTERN_API_C( void )
  94. CFPreferencesSetValue            (CFStringRef             key,
  95.                                  CFTypeRef                 value,
  96.                                  CFStringRef             appName,
  97.                                  CFStringRef             user,
  98.                                  CFStringRef             host);
  99.  
  100. EXTERN_API_C( Boolean )
  101. CFPreferencesSynchronize        (CFStringRef             appName,
  102.                                  CFStringRef             user,
  103.                                  CFStringRef             host);
  104.  
  105. /* Constructs and returns the list of the name of all applications which have preferences in the scope of the given user and host.
  106.     The returned value must be released by the caller; neither argument may be NULL. */
  107. EXTERN_API_C( CFArrayRef )
  108. CFPreferencesCopyApplicationList (CFStringRef             userName,
  109.                                  CFStringRef             hostName);
  110.  
  111. /* Constructs and returns the list of all keys set in the given location.  
  112.    The returned value must be released by the caller; all arguments must be non-NULL */
  113. EXTERN_API_C( CFArrayRef )
  114. CFPreferencesCopyKeyList        (CFStringRef             appName,
  115.                                  CFStringRef             userName,
  116.                                  CFStringRef             hostName);
  117.  
  118.  
  119. #if PRAGMA_STRUCT_ALIGN
  120.     #pragma options align=reset
  121. #elif PRAGMA_STRUCT_PACKPUSH
  122.     #pragma pack(pop)
  123. #elif PRAGMA_STRUCT_PACK
  124.     #pragma pack()
  125. #endif
  126.  
  127. #ifdef PRAGMA_IMPORT_OFF
  128. #pragma import off
  129. #elif PRAGMA_IMPORT
  130. #pragma import reset
  131. #endif
  132.  
  133. #ifdef __cplusplus
  134. }
  135. #endif
  136.  
  137. #endif /* __COREFOUNDATION_CFPREFERENCES__ */
  138.  
  139.